public class Main {
    public static void main(String[] args) {
        String str = "AaBbCc遇事问春风乄" ;
        System.out.println(str.toUpperCase());//AABBCC遇事问春风乄
        System.out.println(str.toLowerCase());//aabbcc遇事问春风乄
    }
    public static void main4(String[] args) {
        String str = " hello world " ;
        System.out.println("["+str+"]");//[ hello world ]
        System.out.println("["+str.trim()+"]");//[hello world]
    }
    public static void main3(String[] args) {
        String str = "helloworld" ;
        System.out.println(str.substring(5));//world
        System.out.println(str.substring(0, 5));//hello
    }
    public static void main2(String[] args) {
        String str = "hello world hello bit" ;
        String[] result = str.split(" ") ; // 按照空格拆分
        for(String s: result) {
            System.out.println(s);
        }
        //hello
        // world
        // hello
        // bit
    }


    public static void main1(String[] args) {
        String str = "helloworld" ;
        System.out.println(str.replaceAll("l", "_")); //he__owor_d
        System.out.println(str.replaceFirst("l", "_")); //he_loworld
    }
}


